﻿package com.sgcc.nfc.lock.presentation.common

import kotlinx.coroutines.channels.BufferOverflow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow

class EventFlow<T> {
    private val _events = MutableSharedFlow<T>(extraBufferCapacity = 1, onBufferOverflow = BufferOverflow.DROP_OLDEST)
    val events: SharedFlow<T> = _events

    suspend fun emit(event: T) {
        _events.emit(event)
    }
}
